<?php
    // estilos -- ver por qué no puedo usar class con un css - otra clase debe estar bloqueandolo
    $tabla_orga_td = 'vertical-align: middle; background-color: ; border: none;';    

    // imagenes
    $prev_img = $this->Html->image("restaurante/ic_navegar_left.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_left"));    
    $next_img = $this->Html->image("restaurante/ic_navegar.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_right"));    
    $prev_img_disabled = $this->Html->image("restaurante/ic_nav_left_disabled.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_left_disabled"));    
    $next_img_disabled = $this->Html->image("restaurante/ic_navegar_disabled.png", array("width" => "32px", "height" => "32px", "id" => "nav_icon_right_disabled"));    


    $volver_img = $this->Html->image("restaurante/ic_back.png", array("id" => "back_icon"));    
    $nuevo_img = $this->Html->image("restaurante/ic_add.png", array("id" => "add_icon"));    
    $cancel_img = $this->Html->image("restaurante/ic_cancel.png", array("id" => "back_icon"));    
    $save_img = $this->Html->image("restaurante/ic_ok.png", array("id" => "save_icon"));    
    
    $editar_img = $this->Html->image("restaurante/doc_images.png", array("width" => "100px", "height" => "100px"));    
    
    $qr_img = $this->Html->image("restaurante/qrcode.png", array("width" => "24px", "height" => "24px"));    
    
    $var_codigo = $this->request->data['Descuento']['codigo'];
    
    include('C:/webroot/cake_2_4_6/tdp-2-web/app/Vendor/phpqrcode/qrlib.php');
?>

<!--- MARCO DE LA PANTALLA ------>
<table><tr><td style="width: 25%; border: none;"></td>
        <td style="padding: 20px; background: white;<?php echo $tabla_orga_td;?>">

<table>
    <tr>
        <td style="width: 15%; text-align:right; <?php echo $tabla_orga_td;?>"><div><?php echo $this->Html->image("restaurante/ic_resto.png", array("id" => "resto_icon"));?></div></td>
        <td style="width: 55%; text-align:left; <?php echo $tabla_orga_td;?>"><h1 class="titulo_ventana_2">Editar descuento</h1></td>
        <td style="width: 30%; text-align:right; <?php echo $tabla_orga_td;?>">
            <table>
                <tr><td style="text-align:right; <?php echo $tabla_orga_td;?>"><?php echo 'Usuario: '.$nombre_usuario;?></td></tr>
                <tr><td style="text-align:right; <?php echo $tabla_orga_td;?>"><?php echo $this->Html->link('Cerrar sesión', array("controller"=>"users", "action"=>"logout"), array('title' => 'Cerrar sesión', 'escape' => false));?></td></tr>
            </table>
        </td>
    </tr>      
</table>
<hr>

<?php echo $this->Form->create('Descuento'); ?>

<?php //echo '<div align="center">' .$this->Qrcode->text($var_codigo).'</div>';?>


<?php 

//check the class is exist or not
if(class_exists('QRcode')){
    //QRcode::png($var_codigo, 'C:/webroot/cake_2_4_6/tdp-2-web/app/webroot/img/restaurante/qrcode.png');
    QRcode::png($var_codigo, '../webroot/img/restaurante/qrcode.png','H',10,3);
    echo '<div align="center">' .$this->Html->image("restaurante/qrcode.png", array("id" => "qr_img")).'</div>';
}else{
    echo 'class is not loaded properly';
}
?>

<table style="<?php echo $tabla_orga_td;?>">
    <tr style="<?php echo $tabla_orga_td;?>">
        <td style="width:30%; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('codigo', array('label' => 'Código', 'disabled' => 'disabled')); ?></td>    
        <td style="width:70%; <?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('titulo', array('label' => 'Título', 'disabled' => 'disabled')); ?></td>    
    </tr>
    <tr style="<?php echo $tabla_orga_td;?>"><td colspan="2" style="width:100%;<?php echo $tabla_orga_td;?>"><?php echo $this->Form->input('descripcion', array('label' => 'Descripción', 'disabled' => 'disabled')); ?></td></tr>
</table>

<table>
    <tr>
        <td style="width: 10%; text-align:right; <?php echo $tabla_orga_td;?>"><?php echo 'Volver'; ?></td>
        <td style="width: 10%; text-align:left; <?php echo $tabla_orga_td;?>"><?php echo $this->Html->link($volver_img, array("controller"=>"descuentos", "action"=>"index"), array('class' => 'button', 'title' => 'Cancelar', 'escape' => false));?></td>
        <td style="width: 80%; <?php echo $tabla_orga_td;?>"></td>
    </tr>
</table>


<?php echo $this->Form->end(); ?>

<!--- FIN MARCO DE LA PANTALLA ------>
</td><td style="width: 25%; border: none;"></tr></table>
